package com.dobbinsoft.iotechn.core.constant;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: rize
 * Date: 2018-08-11
 * Time: 下午11:43
 */
public class Const {

    public static final Map<String, Integer> LANGUAGE_INDEX_MAP = new HashMap<>();

    public static final List<Class> IGNORE_PARAM_LIST = new ArrayList<>();

    static {
        IGNORE_PARAM_LIST.add(Integer.class);
        IGNORE_PARAM_LIST.add(Long.class);
        IGNORE_PARAM_LIST.add(String.class);
        IGNORE_PARAM_LIST.add(Float.class);
        IGNORE_PARAM_LIST.add(Double.class);
        IGNORE_PARAM_LIST.add(Boolean.class);
    }

    static {
        LANGUAGE_INDEX_MAP.put("zh", 0);
        LANGUAGE_INDEX_MAP.put("en", 1);
    }

    public static final Integer USER_SESSION_EXPIRE_MINUTES = 60 * 24 * 5;

    public static final Integer DEVELOPER_SESSION_EXPIRE_MINUTES = 60 * 24;

    public static final Integer CACHE_ONE_DAY = 60 * 60 * 24;

    public static final Integer CACHE_HALF_DAY = 60 * 60 * 12;

    public static final String USER_ACCESS_TOKEN = "ACCESSTOKEN";

    public static final String USER_REDIS_PREFIX = "USER_SESSION_";

    public static final String DEVELOPER_ACCESS_TOKEN = "DEVELOPERTOKEN";

    public static final String DEVELOPER_REDIS_PREFIX = "DEVELOPER_SESSION_";

    public static final String HEADER_IP = "X-Forwarded-For";

    public static final String DB_M = "master";

    public static final String DB_S = "slave";

}
